<html>
<head><meta charset="utf-8"><title>nounwind intrinsics? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nounwind.20intrinsics.3F.html">nounwind intrinsics?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="171217285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nounwind%20intrinsics%3F/near/171217285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nounwind.20intrinsics.3F.html#171217285">(Jul 18 2019 at 23:25)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> I just saw <a href="https://github.com/rust-lang/rust/blob/2eb0bc5e3c52a34b6d62ab0527520c66e4c575bd/src/librustc_codegen_llvm/attributes.rs#L282-L286" target="_blank" title="https://github.com/rust-lang/rust/blob/2eb0bc5e3c52a34b6d62ab0527520c66e4c575bd/src/librustc_codegen_llvm/attributes.rs#L282-L286">https://github.com/rust-lang/rust/blob/2eb0bc5e3c52a34b6d62ab0527520c66e4c575bd/src/librustc_codegen_llvm/attributes.rs#L282-L286</a>. Doesn't that code make intrinsics <code>nounwind</code>? We have an intrinsic that compiles to a panic or a NOP; <code>panic_if_uninhabited</code>. Is that a problem?</p>



<a name="171218268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nounwind%20intrinsics%3F/near/171218268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nounwind.20intrinsics.3F.html#171218268">(Jul 18 2019 at 23:47)</a>:</h4>
<p>Rust intrinsics do not end up being generated as function calls, they are generated as a sequence of instructions inline.</p>



<a name="171218411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nounwind%20intrinsics%3F/near/171218411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nounwind.20intrinsics.3F.html#171218411">(Jul 18 2019 at 23:50)</a>:</h4>
<p>Perhaps a better way to explain this is: you cannot ever get a function pointer to an intrinsic.</p>



<a name="171218420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nounwind%20intrinsics%3F/near/171218420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nounwind.20intrinsics.3F.html#171218420">(Jul 18 2019 at 23:51)</a>:</h4>
<p>The compiler will just throw a block of ice in your face.</p>



<a name="171235730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nounwind%20intrinsics%3F/near/171235730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nounwind.20intrinsics.3F.html#171235730">(Jul 19 2019 at 07:20)</a>:</h4>
<p>okay. I guess I was confused because in MIR, they still are function calls (and that's how Miri sees them). But this code here in in LLVM lowering, so what you say makes sense. Thanks!</p>



<a name="171236385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nounwind%20intrinsics%3F/near/171236385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nounwind.20intrinsics.3F.html#171236385">(Jul 19 2019 at 07:35)</a>:</h4>
<p>nit: a whole bunch of intrinsics do lower to LLVM level calls (of LLVM intrinsics), but I think those don't go through that code path either.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>